<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div {
            background-color: dodgerblue;
        }
    </style>
</head>
<body>
<div id="app">
</div>
<script src="../../js/vue.js"></script>
<script>

    const app = Vue.createApp({
        template: `
            <goodsItem></goodsItem>
            <goodsItem></goodsItem>
            <goodsItem></goodsItem>
        `
    })

    //注册全局组件
    //如果同时传递一个组件名字符串及其定义，则注册一个全局组件
    //app.component('组件名称',{options})
    app.component("goodsItem", {
        template: `
        <div>
            <h1>我是一个组件</h1>
        </div>
        `
    })
    app.mount("#app")
</script>
</body>
</html>
